From dc6d67804fbf043e53f8f7805c7a39b279a47f5a Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 27 Oct 2016 11:55:52 +0200 Subject: [PATCH] xenstore: fix add_change_node() add_change_node() in xenstored is used to add a modified node to the list of changed nodes of one transaction. It is being called with the recurse parameter set to true when removing a node in order to get watches for children of the node fired at transaction end, too. If, however, the node to be deleted had been modified in the same transaction the recurse parameter of add_change_node() is lost as an entry already in the list of the changed nodes won't be entered again. Signed-off-by: Juergen Gross Reviewed-by: Wei Liu Release-acked-by: Wei Liu --- tools/xenstore/xenstored_transaction.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c index 34720fa6d4..84cb0bfac5 100644 --- a/tools/xenstore/xenstored_transaction.c +++ b/tools/xenstore/xenstored_transaction.c @@ -102,9 +102,13 @@ void add_change_node(struct transaction *trans, const char *node, bool recurse) return; } - list_for_each_entry(i, &trans->changes, list) - if (streq(i->node, node)) + list_for_each_entry(i, &trans->changes, list) { + if (streq(i->node, node)) { + if (recurse) + i->recurse = recurse; return; + } + } i = talloc(trans, struct changed_node); i->node = talloc_strdup(i, node); -- 2.30.2